package org.dtrd.config.wechat.entity.bean.officialaccount.template;

import lombok.Data;
import org.dtrd.config.wechat.entity.bean.officialaccount.WechatOaTemplateMsg;

/**
 * @author xiao
 * @date 2022/5/31 3:44 PM
 */
@Data
public class OrderDeliveryMsg extends WechatOaTemplateMsg {

    /**
     * 收货人
     */
    private String msgTitle;

    /**
     * 收货人
     */
    private String contactPerson;

    /**
     * 收货人电话
     */
    private String contactPhone;

    /**
     * 物流公司
     */
    private String logisticsName;

    /**
     * 物流单号
     */
    private String logisticsNo;


    public static final class OrderDeliveryMsgBuilder {

        private OrderDeliveryMsg orderDeliveryMsg;

        private OrderDeliveryMsgBuilder() {
            orderDeliveryMsg = new OrderDeliveryMsg();
        }

        public static OrderDeliveryMsgBuilder getInstance() {
            return new OrderDeliveryMsgBuilder();
        }


        public OrderDeliveryMsg.OrderDeliveryMsgBuilder buildOrderPsySuccessMsg(String msgTitle, String contactPerson, String contactPhone, String logisticsName, String logisticsNo, String remark) {
            this.withMsgTitle(msgTitle)
                    .withContactPerson(contactPerson)
                    .withContactPhone(contactPhone)
                    .withLogisticsName(logisticsName)
                    .withLogisticsNo(logisticsNo)
                    .withRemark(remark);
            return this;
        }

        public OrderDeliveryMsgBuilder withMsgTitle(String msgTitle) {
            orderDeliveryMsg.setMsgTitle(msgTitle);
            return this;
        }

        // public OrderDeliveryMsgBuilder withUrl(String url) {
        //     orderDeliveryMsg.setUrl(url);
        //     return this;
        // }

        public OrderDeliveryMsgBuilder withRemark(String remark) {
            orderDeliveryMsg.setRemark(remark);
            return this;
        }

        public OrderDeliveryMsgBuilder withContactPerson(String contactPerson) {
            orderDeliveryMsg.setContactPerson(contactPerson);
            return this;
        }
        public OrderDeliveryMsgBuilder withContactPhone(String contactPhone) {
            orderDeliveryMsg.setContactPhone(contactPhone);
            return this;
        }

        public OrderDeliveryMsgBuilder withLogisticsName(String logisticsName) {
            orderDeliveryMsg.setLogisticsName(logisticsName);
            return this;
        }

        public OrderDeliveryMsgBuilder withLogisticsNo(String logisticsNo) {
            orderDeliveryMsg.setLogisticsNo(logisticsNo);
            return this;
        }

        public OrderDeliveryMsg build() {
            return orderDeliveryMsg;
        }
    }
}
